package view
{
	import datas.MessageSWF;
	import datas.Monster;
	import datas.datasInterior.MessSWF;
	
	import events.LoadedSWF;
	import events.SWFComplete;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	
	public class Details extends Sprite
	{
		//加载的swf信息
		private var message:MessageSWF = MessageSWF.getInstace();
		//加载的动画信息
		private var cartoon:MessSWF = new MessSWF("one");
		
		private var monster:Monster = Monster.getInstance("one");
		
		//private var _subtraction:uint;
		
		public var bg:MovieClip;
		public var monster2:MovieClip;
		public function Details()
		{
			super();
			//动画部分是否加载完成
			cartoon.addEventListener(LoadedSWF.LOADEDSWF,onLoadedSWF);
		}
		public function onLoadedSWF(event:Event):void
		{
			//获取SWF内部的元件
			bg = MessageSWF.getMovieClip(message.element,"Map1") as MovieClip;
			monster2 = MessageSWF.getMovieClip(message.element,"Monster2") as MovieClip;
			monster2.blood = monster.blood;
			//this.addChild(bg);
			
			//素材全部加载完成
			this.dispatchEvent(new SWFComplete(SWFComplete.SWFCOMP));
		}

		/*public function set subtraction(value:uint):void
		{
			_subtraction = value;
			var now:uint = monster2.blood;
			now = now - _subtraction;
			monster2.blood = now;
		}*/

	}
}